<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="sf"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->

<!-- Bootstrap -->
<link rel="stylesheet" href="resource/css/bootstrap.min.css">
<link rel="stylesheet"
	href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">

<!-- this page specific styles -->
<link rel="stylesheet" href="resource/css/customer/index.css"
	media="screen" />

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]-->
<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<!--[endif]-->
<title></title>
</head>
<body>
	<div class="container">
		<nav>
			<ul class="nav nav-tabs" role="tablist">
				<li role="presentation" class="active"><a href="#productlist"
					aria-controls="" role="tab" data-toggle="tab"> 产品管理 </a></li>
				<li><a href="#creatproductinfo" aria-controls="" role="tab"
					data-toggle="tab"> 添加产品 </a></li>
			</ul>
		</nav>
	</div>

	<div class="tab-content ">
		<div class="tab-pane active" role="tabpanel" id="productlist">
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">筛选</h3>
				</div>
				<div class="panel-body">
					<div class="container-fluid">
						<form class="form-horizontal" method="get" action="serch">
							<div class="form-group class="dropdown" row">
								<label class="control-label col-lg-2">分类</label>
								<div class="col-lg-4">
									<select class="form-control" id="first">
										<option value="">请选择一级类别</option>
										<c:forEach items="${firstTypeList}" var="fl">
											<option value="${fl.id}">${fl.typeName}</option>
										</c:forEach>
									</select>
								</div>
								<div class="col-lg-4 col-lg-offset-1">
									<select class="form-control" id="second" name="serchId">
										<option value="">请选择二级类别</option>
										<c:forEach items="${secondTypeList}" var="sl">
											<option value="${sl.id}">${sl.typeName}</option>
										</c:forEach>
									</select>
								</div>
							</div>
							<div class="form-group row ">
								<label for="queryName" class="control-label col-lg-2">关键字</label>
								<div class="input-group col-lg-8">
									<input class="form-control" type="text" id="queryName"
										aria-describedby="serch" name="keyValue" /> <span
										class="glyphicon glyphicon-search input-group-addon"
										id="serch"><input type="submit" value="搜索"></span>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
			<div class="container-fluid">
				<table class="table table-striped table-hover table-responsive ">
					<thead>
						<tr>
							<td>产品名称</td>
							<td>一级分类</td>
							<td>二级分类</td>
							<td>最新价格（单位/元）</td>
							<td>操作</td>
						</tr>
					</thead>
					<tbody>

						<c:forEach items="${productList}" var="p">
							<tr>
								<td>${p.pName}</td>
								<td>${p.productType.parentType.typeName}</td>
								<td>${p.productType.typeName}</td>
								<td>${p.pPrice}</td>
								<td><a href="updateProduct?id=${p.id}">编辑</a> <a
									href="delProduct?id=${p.id}">删除</a></td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>
			<table class="table table-striped table-hover table-responsive ">
				<tbody>
					<div class="table-bordered">
						<tr>
							<td>地址：${companyInfo.address}</td>
						</tr>
					</div>
					<div class="table-bordered">
						<tr>
							<td>电话：${companyInfo.tel}</td>
						</tr>
					</div>
					<div class="table-bordered">
						<tr>
							<td>转账账号：${companyInfo.bankNum}</td>
						</tr>
					</div>
					<div class="table-bordered">
						<tr>
							<td>备注：${companyInfo.notes}</td>
						</tr>
					</div>
					<div class="table-bordered">
						<tr>
							<td>注意事项 :${companyInfo.description}</td>
						</tr>
					</div>
				</tbody>
			</table>
		</div>

		<div class="tab-pane" role="tabpanel" id="creatproductinfo">
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">添加产品</h3>
				</div>
				<div class="panel-body">
					<div class="container-fluid">
						<sf:form class="form-horizontal" method="post"
							modelAttribute="product" action="home?new">
							<div class="form-group">
								<label for="order" class="control-label col-lg-2">排序</label>
								<div class="col-lg-9">
									<sf:input path="order" class="form-control" type="text"
										id="order" />
								</div>
							</div>
							<div class="form-group">
								<label for="pName" class="control-label col-lg-2">名称</label>
								<div class="col-lg-9">
									<sf:input path="pName" class="form-control" type="text"
										id="pName" />
								</div>
							</div>
							<div class="form-group">
								<label for="pPrice" class="control-label col-lg-2">价格</label>
								<div class="col-lg-9">
									<sf:input path="pPrice" class="form-control" type="text"
										id="pPrice" />
								</div>
							</div>
							<div class="form-group row">
								<label class="control-label col-lg-2">类别</label>
								<div class="col-lg-4">
									<select class="form-control" id="firstName">
										<option value="">请选择一级类别</option>
										<c:forEach items="${firstTypeList}" var="fl">
											<option value="${fl.id}">${fl.typeName}</option>
										</c:forEach>
									</select>
								</div>
								<div class="col-lg-4 col-lg-offset-1">
									<select class="form-control" id="secondName" name="secondName">
										<option value="">请选择二级类别</option>
										<c:forEach items="${secondTypeList}" var="sl">
											<option value="${sl.id}">${sl.typeName}</option>
										</c:forEach>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label for="notes" class="control-label col-lg-2">备注</label>
								<div class="col-lg-9">
									<sf:textarea path="notes" class="form-control" id="notes" />
								</div>
							</div>
							<div class="form-control-static col-lg-3 col-lg-offset-5">
								<input type="submit" class="btn btn-success btn-lg" value="提交">
							</div>
						</sf:form>
					</div>
				</div>
			</div>
		</div>
	</div>




	<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
	<script src="resource/js/jquery.min.js"></script>
	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="resource/js/bootstrap.min.js"></script>
</body>
</html>